﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MusteriTakipProgrami
{

    public partial class ReferansBul : Form
    {

        public ReferansBul()
        {
            InitializeComponent();
        }


        private void ReferansBul_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'mUSTERITAKIPDataSet4.MUSTERI' table. You can move, or remove it, as needed.
            this.mUSTERITableAdapter.Fill(this.mUSTERITAKIPDataSet4.MUSTERI);

        }

        private void aRToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.mUSTERITableAdapter.aR(this.mUSTERITAKIPDataSet4.MUSTERI, aDToolStripTextBox.Text, sOYADToolStripTextBox.Text);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void referans_AraToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.mUSTERITableAdapter.Referans_Ara(this.mUSTERITAKIPDataSet4.MUSTERI, aDToolStripTextBox.Text, sOYADToolStripTextBox.Text, ((int)(System.Convert.ChangeType(iDToolStripTextBox.Text, typeof(int)))));
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }
        //public static int refid;
        //public static string refad;
        //public static string refsoyad;


        private string refim;
        public string REFIM
        {
            get
            {
                return refim;
            }
        }
        private void ReferansEkle_Click(object sender, EventArgs e)
        {
            this.Text = this.dataGridView2.SelectedRows[0].Cells[0].Value.ToString();
            refim = this.dataGridView2.SelectedRows[0].Cells[0].Value.ToString();




            // refid = Int32.Parse(this.dataGridView2.SelectedRows[0].Cells[0].Value.ToString());
            // refad = this.dataGridView2.SelectedRows[0].Cells[1].Value.ToString();
            // refsoyad = this.dataGridView2.SelectedRows[0].Cells[2].Value.ToString();
            // MusteriKayit.deneme = refid;
            //// MessageBox.Show("deneme:" + MusteriKayit.deneme.ToString());
            // this.Close();
            //MusteriKayit.Referans_TB2.Text = ReferansBul.refid.ToString();
        }
    }
}
